<template>
    <h1>Vue 3组件间通信</h1>
    <div class="component_container">
        <div class="component_nav">
            <RouterLink to="/com_prop" class="nav-style" active-class="nav_active">prop</RouterLink>
            <RouterLink to="/com_custom" class="nav-style" active-class="nav_active">自定义</RouterLink>
            <RouterLink to="/com_mitt" class="nav-style" active-class="nav_active">mitt</RouterLink>
            <RouterLink to="/com_vmodel" class="nav-style" active-class="nav_active">Vmodel</RouterLink>
        </div>
        <RouterView></RouterView>
    </div>
</template>

<script setup lang="ts">
import { RouterLink,RouterView } from 'vue-router';
</script>

<style scoped>
.component_container{
    background-image: linear-gradient(to top, #4481eb 0%, #04befe 100%);
    box-shadow: 0 0 10px;
    border-radius: 10px;
    padding: 20px;
    display: flex;
}
.component_nav{
    width: 20%;
    border: 1px solid #ccc;
    border-radius: 20px;
    background-color: #fff;
    box-shadow: 0 0 10px;
}
.component_nav a{
    text-decoration: none;
    text-align: center;
    padding: 20px;
    display: block;
}
.component_nav a:first-of-type{
    border-radius: 20px 20px 0 0;
}
.component_nav a:last-of-type{
    border-radius:0 0 20px 20px ;
}
.nav_active{
    background-color: #07bcfe;
    color: #4481eb;
}
.nav-style{
    /* height: 70px;
    line-height: 70px;
    color: #04befe;
    border: 1px #fff solid;
    text-align: center;
    width: 100%; */
}
</style>